Upload API
API Endpoint
| Name of the API | Inputs Supported |
|---|---|
upload | User ID and Image |
API Description
Objective
You can pre-upload documents for a user ID before doing the video call using the Upload API.
API URL
https://vcip.hyperverge.co/upload
Overview
The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.
Authentication
You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.
API Request Details
Method - POST
Headers
| Parameter | Mandatory or Optional | Description | Valid Values |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload. | multipart/form-data |
| appId | Mandatory | [ Type: string ] Application ID shared by HyperVerge | N/A. This is a unique value. |
| appKey | Mandatory | [ Type: string ] Application Key shared by HyperVerge | N/A. This is a unique value. |
| transactionId | Mandatory | Unique ID for the customer journey. | N/A. Any defined unique value mapped to a transaction in your business ecosystem. |
Request Body
The following table provides information on the parameters used in the request body of the User API .
| Parameter | Mandatory or Optional | Description |
|---|---|---|
userId | Mandatory | [Type:String] The unique user identity. |
imageType | Mandatory | [Type:String] |
image | Mandatory | [Type:file] |
Sample Request
The following code shows a standard curl request for the API.
curl --location --request POST 'https://vcip.hyperverge.co/upload' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'userId="<Enter_user_ID>"' \
--form 'imageType="<Enter_image_type>"' \
--form 'image=@"<path_to_image_file>"'
Success Response Sample
The following is a sample response when the document is uploaded succesfully.
{
"status": "success",
"statusCode": 200
}
Failure Response Sample
The following is a sample failure response where some document uploaded succesfully while some failed.
{
"status": "success",
"statusCode": 207,
"successResult": [
{
"pan": {
"statusCode": 200
}
}
],
"failureResult": [
{
"aadhaarFront": {
"statusCode": 500,
"error": "something went wrong"
}
}
]
}
Failure and Error Response Sample
The following is a sample response.
- Error - Incorrect imageType, image file or userId missing
- Error - Uploaded documents not available
- Error - Upload option disabled
- Error - Format not supported
- Error - Invalid request
- Error - Server Error
{
"status": "failure",
"statusCode": 400,
"error": "value must contain at least one of [pan, aadhaarFront, aadhaarBack]"
}
{
"status": "failure",
"statusCode": 404,
"error": "document: ['license'] not found"
}
{
"status": "failure",
"statusCode": 406,
"error": "upload option not enabled"
}
{
"status": "failure",
"statusCode": 415,
"error": "upload option not enabled"
}
{
"status": "failure",
"statusCode": 422,
"error": "Unprocessable Entity"
}
{
"status": "failure",
"statusCode": 500,
"message": "Something went wrong"
}
Error Response Details
| Status Code | Error Message | Error Description |
|---|---|---|
| 207 | "something went wrong" | Some of the documents were uploaded succesfully while some failed. |
| 400 | "value must contain at least one of [pan, aadhaarFront, aadhaarBack]" | Invalid request for incorrect imageType, image file or userId missing. |
| 404 | "document: ['license'] not found" | Invalid request when uploaded document(s) are not present in workflow. |
| 406 | "upload option not enabled" | Invalid request when document upload option is disabled from workflow config. |
| 415 | "pdf for pan is not supported" | Invalid request when uploaded document format for the document is not supported. |
| 422 | "Unprocessable Entity" | Invalid request when OCR could not be performed on the uploaded document. |
| 500 | "Something went wrong" | Server Error. Please contact the HyperVerge team. |